﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using iShoppingBUS;
using iShoppingDTO;

namespace iShopping.Admin
{
    public partial class CauHinhGiaoDien : System.Web.UI.Page
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            string maTheme = Request.QueryString["theme"].ToString();
            GiaoDienDTO giaoDienDto = GiaoDienBUS.SelectGiaoDienMa(maTheme);
            if (giaoDienDto != null)
            {
                this.Theme = giaoDienDto.TenTheme;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string maTheme = Request.QueryString["theme"].ToString();
            GiaoDienDTO giaoDienDto = GiaoDienBUS.SelectGiaoDienMa(maTheme);
            if (giaoDienDto != null)
            {
                GiaoDienDTO giaoDienDtos = new GiaoDienDTO();
                giaoDienDtos.MaGiaoDien = "Theme001";
                giaoDienDtos.TenTheme = giaoDienDto.TenTheme;
                bool result = GiaoDienBUS.UpdateGiaoDien(giaoDienDtos);
                if(result)
                {
                    Label1.Text = "THAY ĐỔI GIAO DIỆN THÀNH CÔNG";
                }
            }
           
        }
    }
}
